package cn.com.bluemoon.daps.standard.service;

import cn.com.bluemoon.daps.common.mp.IBmService;
import cn.com.bluemoon.daps.standard.entity.DapStandardBasic;
import cn.com.bluemoon.daps.standard.entity.DapStandardBasicDic;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 基础标准-字典代码表 服务类
 * </p>
 *
 * @author admin
 * @since 2020-08-03
 */
@Validated
public interface DapStandardBasicDicService extends IBmService<DapStandardBasicDic> {

    /**
     * @param standardId 标准id
     * @param isLogicDel 是否逻辑删除 默认为false
     */
    void deleteByStandardId(String[] standardId, boolean isLogicDel);

    /**
     * 保存字典信息（upsert)
     */
    void mySaveOrUpdateBatch(@NotNull(message = "标准不可为空") DapStandardBasic dapStandardBasic,
                             List<DapStandardBasicDic> basicDics,
                             @NotNull(message = "标准id不可为空") String standardId);

    /**
     * DapStandardBasicDic::getBaseCode, DapStandardBasicDic::getBaseCodeName
     * isPublished false 全部， true只取已发布的
     *
     * @return 获取代码中英文名称
     */
    Map<String, String> findDistinceBaseCodeAndName();
}
